<template>
	<!-- //审批通过弹窗 -->
	<el-dialog title="审批通过" center v-model="dialogVisible" width="536" class="radius8" :before-close="handleClose">
		<div>
			<!-- <el-form class="pt20" style="padding-bottom: 0;" label-width="100px" :model="form" ref="queryForm"
				:inline="true" :rules="rules">
				<el-form-item label="备注信息" prop="paymentRemark">
					<el-input size="large" type="textarea" resize="none" class="textReset" style="width: 560px;"
						:rows="5" v-model="form.paymentRemark" placeholder="请输入信息" />
				</el-form-item>
				<el-form-item label="通知人员" prop="notifiedEmployeeId">
					<div>
						<el-select v-model="form.notifiedEmployeeId" multiple placeholder="请选择" size="large"
							style="width: 200px">
							<el-option v-for="dict in teamOptions" :key="dict.userId" :label="dict.userName"
								:value="dict.userId" />
						</el-select>
						<div class="color-red fs12">注：审批完成后，将自动通知到所选人员</div>
					</div>
				</el-form-item>
			</el-form>	 -->
			<div class="mt15">
				<el-input size="large" type="textarea" resize="none" class="textReset"
				show-word-limit v-model="item.flyflow.approveDesc"
					:rows="6"  placeholder="请输入备注信息" maxlength="300" />
			</div>
			<div slot="footer" class="dialog-footer text-right mt30">
				<el-button class="cancelSubBtn" @click="result = '',dialogVisible = false">取 消</el-button>
				<el-button type="primary" @click="resultSubmit()" class="mainSubBtn">确 定</el-button>
			</div>
		</div>
	</el-dialog>
</template>

<script>
	import{
		auditOrder
	} from "@/api/business/order"
	import {
		getUserListData//业务经理
	} from "@/api/business/teamOpportunity";
	export default{
		props:{
			item:{
				type:Object,
				default:res=>{return {}}
			},
			type:{
				type:Number,
				default:1,//1：默认审核拒绝 0：结束订单
			}
		},
		data(){
			return{
				dialogVisible:false,//结束订弹窗
				result:'',//结束订单理由
				teamOptions: [], //业务经理
			}
		},
		methods:{
			open(){
				this.dialogVisible = true
				console.log(this.item,'item')
				// this.getUserList()
			},
			handleClose(){
				this.dialogVisible = false
			},
			// 获取业务经理
			getUserList() {
				//获取自己和同部门的用户信息
				getUserListData().then(response => {
					this.teamOptions = response.data;
				});
			},
			//提交
			resultSubmit(){
				this.item.flyflow.approveResult = true
				auditOrder(this.item).then(res=>{
					this.$modal.msgSuccess('已提交')
					this.$emit('refresh')
					this.dialogVisible = false
				})
			}
		}
	}
</script>

<style>
</style>